﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Order_List.aspx.cs" MasterPageFile="~/Admin/Admin.Master"
    Inherits="TimKen.Web.Admin.Order.Order_List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentLinkAction" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentTitle" runat="server">
    <%=GetLangString("OrderConfirm")%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentMain" runat="server">

    <script language="javascript" type="text/javascript">
        function selectAll(obj) {
            var theTable = obj.parentElement.parentElement.parentElement;
            var i;
            var j = obj.parentElement.cellIndex;

            for (i = 0; i < theTable.rows.length; i++) {
                var objCheckBox = theTable.rows[i].cells[j].firstChild;
                if (objCheckBox.checked != null) objCheckBox.checked = obj.checked;
            }
        }
    </script>

    <div class=" form-div">
        <img src="../images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
        <%=GetLangString("OrderNo") %>：
        <asp:TextBox ID="txtOrderNo" runat="server"></asp:TextBox>
        <%=GetLangString("OrderDate")%>：<asp:TextBox ID="txtCreateDateBegin" runat="server"
            onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'ctl00_ContentMain_txtCreateDateBegin\')}',dateFmt:'yyyy-MM-dd'})"></asp:TextBox>---
        <asp:TextBox ID="txtCreateDateEnd" runat="server" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'ctl00_ContentMain_txtCreateDateEnd\')}',dateFmt:'yyyy-MM-dd'})"></asp:TextBox>
        <asp:DropDownList ID="ddlOrderStatus" runat="server" AppendDataBoundItems="true">
        </asp:DropDownList>
        <asp:Button ID="btnSearch" runat="server" CssClass="button" OnClick="btnSearch_Click" />
    </div>
    <div class="list-div">
        <asp:GridView ID="grdOrderList" runat="server" AutoGenerateColumns="False" DataKeyNames="OrderID"
            CssClass="grid" OnSorting="grdOrderList_Sorting" OnRowDataBound="grdOrderList_RowDataBound">
            <Columns>
                <asp:TemplateField>
                    <ItemStyle Width="150" />
                    <HeaderStyle HorizontalAlign="Center" />
                    <HeaderTemplate>
                        
                        <%=GetLangString("OrderNo") %>
                    </HeaderTemplate>
                    <ItemTemplate>
                       <%#Eval("OrderNo")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField SortExpression="Creator" DataField="Creator" />
                <asp:BoundField SortExpression="CreateDate" DataField="CreateDate"  DataFormatString="{0:d}" />
                <asp:BoundField SortExpression="TotalAmount" DataField="TotalAmount" />
                <asp:BoundField SortExpression="TaxAmount" DataField="TaxAmount" />
                <asp:BoundField SortExpression="CardCode" DataField="CardCode" />
                <asp:BoundField SortExpression="ExpectDate" DataField="ExpectDate"  DataFormatString="{0:d}" />
                <asp:BoundField DataField="Status" />
                <asp:TemplateField>
                    <HeaderTemplate>
                        <%=GetLangString("ContractStatus")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("ContractStatus").ToString() !="" ? (Eval("ContractStatus").ToString() == "0" ? GetLangString("ForConfirm") : GetLangString("Confirmed")) : ""%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemStyle Width="80" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        <%=GetLangString("Operation")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <a href='Order_Info.aspx?OrderID=<%#DataBinder.Eval(Container.DataItem, "OrderID")%>'>
                            <img src="../images/icon_detail.gif" alt='<%#GetLangString("DetailInfo")%>' /></a>
                        <a href="OrderShip_Info.aspx?OrderID=<%#Eval("OrderID") %>">
                            <img src="../../images/delivery.jpg" alt="<%#GetLangString("ShipInfo") %>" /></a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle HorizontalAlign="Center" />
        </asp:GridView>
        <div class="pager-div">
            <ux:AspNetPager ID="AspNetPager1" runat="server" Width="100%" ShowPageIndexBox="Always"
                HorizontalAlign="right" EnableTheming="true" AlwaysShow="true" PageIndexBoxType="DropDownList"
                OnPageChanged="AspNetPager1_PageChanged" ImagePath="/images/" NavigationButtonType="Image"
                ButtonImageNameExtension="n" CpiButtonImageNameExtension="r" PagingButtonType="Image">
            </ux:AspNetPager>
        </div>
    </div>
</asp:Content>
